package teacher.inter;
/*
     接口的引入：
          关键字：interface
          为什么有接口？  解决类不能多继承的问题，而接口可以多实现
 */
public class InterfaceDemo1 {
}
interface RunAnimal{
    public abstract void run();
}
interface SwimmingAnimal{
    public abstract void swimming();
}

class Dog implements RunAnimal,SwimmingAnimal{
    @Override
    public void run() {
        System.out.println("狗能跑");
    }
    @Override
    public void swimming() {
        System.out.println("狗能游泳");
    }
}
